UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hncmb9/zBmUfhltw/20tIhC3rz5gfy/Qu6O481/bQs8='
WHERE
key_id = 'fbc66511615388473f696853dab65f4d6f430ef6b5ea4868655094bd9060608b'
AND (
token = 'hncmb9/zBmUfhltw/20tIhC3rz5gfy/Qu6O481/bQs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)