UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xGH2rBVr+fyXFqc9jijzQbsDq+7Jo/rBIHYVes7JjhM=' 
WHERE 
  key_id = '4bc3a06ccaf0f3d21d9caf80691051aecfe8bc369999b65bec106e8f3c4744a0' 
  AND (
    token = 'xGH2rBVr+fyXFqc9jijzQbsDq+7Jo/rBIHYVes7JjhM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031