UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A47I0e+2AMqr/ZjNDpB7K8QE+KevGtgTyG4sd946E7k='
WHERE
key_id = '64a33447b3d4b9377ec9fcbca56cc7c99a1e6425d4a362413a12f4db4b69a639'
AND (
token = 'A47I0e+2AMqr/ZjNDpB7K8QE+KevGtgTyG4sd946E7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)