UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rCwHHFcUScXjvYytCWtOXB1MWhxF8p+BVVdlNrZdqGE=' 
WHERE 
  key_id = '44a80e18aa601b7a2863191c72f70ebf48a3223681a6e7975f27e4e0b8b3c4a0' 
  AND (
    token = 'rCwHHFcUScXjvYytCWtOXB1MWhxF8p+BVVdlNrZdqGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029