UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KZDqDT+Mu2tKFS/TUQqdc3axKO3oef/hyAE+jX5QhHc='
WHERE
key_id = '25e9b202c7a3d64a4f275a3a4278c86b2e52d461a5ad78ddce0888b3f2699585'
AND (
token = 'KZDqDT+Mu2tKFS/TUQqdc3axKO3oef/hyAE+jX5QhHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)