UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aoP5dgzyWvtu2S2Eqi7snJtNRHRWiFlIxLJfQLafppA='
WHERE
key_id = '714644ab1090438b3b675c89d480260937458a2499190bdda2245b0e8123a0e3'
AND (
token = 'aoP5dgzyWvtu2S2Eqi7snJtNRHRWiFlIxLJfQLafppA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)