UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rU/MBzmMYgiXUbAXAlr3x/KsaMPcw/1uMIWfctiDCUE='
WHERE
key_id = 'e8a0049381d60b71d61cc67562e0f91f3db31ba3cb7df87b072260de4c3ec810'
AND (
token = 'rU/MBzmMYgiXUbAXAlr3x/KsaMPcw/1uMIWfctiDCUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)