UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y1Xe5fnj0whJCdc5raG15q7r9Df8uwm3Lyh/vbDO5j8=' 
WHERE 
  key_id = 'fab9f9084e65bfc4ca9e2e944b31ba6e262ccf0d41492be497cd7e0c014f7513' 
  AND (
    token = 'Y1Xe5fnj0whJCdc5raG15q7r9Df8uwm3Lyh/vbDO5j8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033