UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ytX80RE//74jHS7qWyM/2hEonX4hwMBzNuDaNIi0N9s='
WHERE
key_id = '11f57a9f51b2813331ce06004739ecc88c10e05900e99e65c22a41dc817dd22d'
AND (
token = 'ytX80RE//74jHS7qWyM/2hEonX4hwMBzNuDaNIi0N9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)