UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k8iXtYDZZWIiRSZjzcLcqm7p0JxzSq1OqGdc8riqcEw=' 
WHERE 
  key_id = '67415e6a281002f926da8e3150c52a582480ecdf873aef1c2abba955c7a81006' 
  AND (
    token = 'k8iXtYDZZWIiRSZjzcLcqm7p0JxzSq1OqGdc8riqcEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055