UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vZnysGJsEf9apCRuuFHJL/ELdYbUfhX+BCSQO0F3bbg='
WHERE
key_id = 'b3f97365b67a9d565288fbe41221b125cc9a1e54402d5c20c8f819580bf1bec1'
AND (
token = 'vZnysGJsEf9apCRuuFHJL/ELdYbUfhX+BCSQO0F3bbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)