UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QZPUZ5v4RlwLmyvSsdDvcEFRBp2TJnDuOoZakO9br/I='
WHERE
key_id = 'e334c1b3502486a2cc89f162718f0cfa95870d2ef7eb10994edb5aff25c3bbd2'
AND (
token = 'QZPUZ5v4RlwLmyvSsdDvcEFRBp2TJnDuOoZakO9br/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)