UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4zrqlXy31wzi8YShiBEveS7ryPMEstLeuqSiKQTZFPA='
WHERE
key_id = '7bdbe0b1095e2648d3618966f73f2e62df4c08eb5db1ad19eb28a4aca0f69421'
AND (
token = '4zrqlXy31wzi8YShiBEveS7ryPMEstLeuqSiKQTZFPA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)