UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'frixPf8E60gT0Fo7g1X/RIDXqnRNsG5xJLPkJD2VJ60='
WHERE
key_id = '1c0dd7eb191fb89bb155922fe0270e1018848eb36106667e80be36daee1101bc'
AND (
token = 'frixPf8E60gT0Fo7g1X/RIDXqnRNsG5xJLPkJD2VJ60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)