UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w2/sbVgZkMPX69caKBaqxS9uLQtpgo8COi3xj7Czfaw='
WHERE
key_id = 'e2d96db10ca978f9c2b5834bc27821f4cb9592cebc8b3da1de5f110766c973d1'
AND (
token = 'w2/sbVgZkMPX69caKBaqxS9uLQtpgo8COi3xj7Czfaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)