UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0q8bT24Fhe6j/RdqnAixsqAdW/NSV5Pk809knm4CQco='
WHERE
key_id = '7222adbd8f418298d75d669ed5f6d5d61a99b9074c094134f844777c7d510005'
AND (
token = '0q8bT24Fhe6j/RdqnAixsqAdW/NSV5Pk809knm4CQco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)