UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lOtiCbQTDlKOLD6MHXEsIECNsZ8TQNzE8eihkcrv8SU=' 
WHERE 
  key_id = '19bd7bf2a9b4b92450cf1388dc968d4e8270e28d5076aa8f5b5f2b106480a320' 
  AND (
    token = 'lOtiCbQTDlKOLD6MHXEsIECNsZ8TQNzE8eihkcrv8SU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042