UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JaGVQiOWXQ5jzW7qnvZOjflDRaVt/CUREKM506AWvSQ=' 
WHERE 
  key_id = 'fc67ad4002552001dd40476dfc46d42c009f007f26f16bd1e43825d7c4336a23' 
  AND (
    token = 'JaGVQiOWXQ5jzW7qnvZOjflDRaVt/CUREKM506AWvSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035