UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8RfEcQ9EjBFaBKsPCwP0DbWc42ibH9UwJBh6DQkrmvM='
WHERE
key_id = '04e119ea8b4d2b79dcc46055b85fcddf236d27fbdeed1bc2ea03935a3819332d'
AND (
token = '8RfEcQ9EjBFaBKsPCwP0DbWc42ibH9UwJBh6DQkrmvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)