UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WL1geYTAedARuGk+WR/mFxUslX3eEFjuu0olZqkV4rQ='
WHERE
key_id = 'c4f01ae943c59e1abe68c8cef0d3500051518d45b963a7442c6fa08bd4ce470c'
AND (
token = 'WL1geYTAedARuGk+WR/mFxUslX3eEFjuu0olZqkV4rQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)