UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UbGbSVAqLyimQ2LtAU2UiS/jAI6NZriAYRi67TYG5yo='
WHERE
key_id = '125195ed79d2c15e35d9683613d290687def06cd9374351bf1d38762076418ea'
AND (
token = 'UbGbSVAqLyimQ2LtAU2UiS/jAI6NZriAYRi67TYG5yo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)