UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yKmDlB8DjO3NbRm8rf8lkns6MEJA8VSjCVdmmpRCKx4='
WHERE
key_id = 'f5e1b10e76597f423e166696bb9131bbc631a80e4b6b10113a4fb76cd034e776'
AND (
token = 'yKmDlB8DjO3NbRm8rf8lkns6MEJA8VSjCVdmmpRCKx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)