UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9zb++53IXQf27HKOJKs+apCC+kDvZKisiSdzqdQ6LeA='
WHERE
key_id = '39f9534fa4bc3f0f207e304f1a60495f985cac47eb364fc9e8d9b77d394c3405'
AND (
token = '9zb++53IXQf27HKOJKs+apCC+kDvZKisiSdzqdQ6LeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)