UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3DcDy41kLtnsq0UPZVAf7BRrm79Gq8Pb20ZRA/4hs+w='
WHERE
key_id = '21976471622500324b2fc08adcff60cf241683dc0775be404f18e4ccf714c465'
AND (
token = '3DcDy41kLtnsq0UPZVAf7BRrm79Gq8Pb20ZRA/4hs+w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)