UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vz2cyKuf3NCLjLlFxnPyHTZjE5ASYBlySzw6ijcwB8s='
WHERE
key_id = '8453831ce1282eb37389cbfa59925d850c5f7bb01d6f9ed57d91c31d234b9895'
AND (
token = 'Vz2cyKuf3NCLjLlFxnPyHTZjE5ASYBlySzw6ijcwB8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)