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