UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'js5bIHz1Vt4Lu9bVVqy3cPn8UOnTbbx5S/XFwOMiTNE='
WHERE
key_id = 'c59d1d04c8877f17ce18b6f1ad324c2ecdf2cad97a46118c2a4122b0887ab604'
AND (
token = 'js5bIHz1Vt4Lu9bVVqy3cPn8UOnTbbx5S/XFwOMiTNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)