UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+6pSgeOCi6uqOKdZdcyTvhRZabCvI8/2yX6rZkin0PY=' 
WHERE 
  key_id = '72915e60135415e2089458887e7a2714e5e0fdbc435cfc3e6e48e494aef6b239' 
  AND (
    token = '+6pSgeOCi6uqOKdZdcyTvhRZabCvI8/2yX6rZkin0PY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031