UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tEo+J/CBnYcxuAwZB/GTUGJPSg0gJFAOdv15a2rRyrc='
WHERE
key_id = '3b65d6b7bd7eb12e02e26e05392a279d3b9e27f38c049b5fbd83f36452159dbc'
AND (
token = 'tEo+J/CBnYcxuAwZB/GTUGJPSg0gJFAOdv15a2rRyrc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)