UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S2zD+lo8f/7lxQ591+IEHjZsUnzGvzdAAAoLs06Vgq0='
WHERE
key_id = 'b13eb0d344c68b195fbfb446cb818c599547c81d48dfab56cfe7a762979320a1'
AND (
token = 'S2zD+lo8f/7lxQ591+IEHjZsUnzGvzdAAAoLs06Vgq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)