UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iBn6hhxnzOuffAcGaW6/aLyteXsHcu/tHy86hoPNTSg=' 
WHERE 
  key_id = 'bc3aa5165a05605baf0a3dc175f0ad1d3f3302f0bdcff9ceb2e04921e175d97b' 
  AND (
    token = 'iBn6hhxnzOuffAcGaW6/aLyteXsHcu/tHy86hoPNTSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037