UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4xyymVxSFucHv1q7wjJJiX0YR4ScoPEhKbscCog7FmY='
WHERE
key_id = '71c00e658ecf94e0c66cd9a76c1de8dba32f3a80836774355bcb13273f9b008a'
AND (
token = '4xyymVxSFucHv1q7wjJJiX0YR4ScoPEhKbscCog7FmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)