UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yTGhxnerFmWwG/jdFfqBIPGrpClbd1GA6pwBz91vMU4='
WHERE
key_id = '6dccd0ad2734584af93a16041c5eeae17bda8387445ab136007c5940f02d6b3f'
AND (
token = 'yTGhxnerFmWwG/jdFfqBIPGrpClbd1GA6pwBz91vMU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)