UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mXD5srOqdS4Yo2mWQVG2QQuaNWs9pv57HRvbbkWMfAQ=' 
WHERE 
  key_id = 'b23cadf4dc02214de352dd883739fa9249f8aed37f26350d0f4282cbfc416591' 
  AND (
    token = 'mXD5srOqdS4Yo2mWQVG2QQuaNWs9pv57HRvbbkWMfAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027