UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RDNnMHdfXa2Z6TiDsMiG2RgOJs5mYJHlqi1Tvrf6oFU='
WHERE
key_id = '98cde2fb97689b785784776a10fecdeb826c8c2f229a67a53f35fc70fdaa8147'
AND (
token = 'RDNnMHdfXa2Z6TiDsMiG2RgOJs5mYJHlqi1Tvrf6oFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)