UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V2UIICtjE+SywgkbUwpuphDGsL+LiuH2lWwRw609Z0U=' 
WHERE 
  key_id = '1d83a62b893fe9fbca6d7805bd9c08e882264b142b344c3454298f5b6f527bf4' 
  AND (
    token = 'V2UIICtjE+SywgkbUwpuphDGsL+LiuH2lWwRw609Z0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021