UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/3jTeyN2+MjOh0ocNW29HoKVQY5mKF51/87IMwkGBNI='
WHERE
key_id = '279140516d8040fdf1de1d167ef9511f3eccf7a8eff274ed12eee59454a1fa29'
AND (
token = '/3jTeyN2+MjOh0ocNW29HoKVQY5mKF51/87IMwkGBNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)