UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2LsRiy4hCu4OQqcoNRxJTNqnyGQXc7HwHbZzKDdhjek='
WHERE
key_id = 'b07d7659e0fd0f5ca4e0ef8504c4468ce7fbc8af0affd1ef31fb2995f4c9e8d8'
AND (
token = '2LsRiy4hCu4OQqcoNRxJTNqnyGQXc7HwHbZzKDdhjek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)