UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tp3SUdyDf3NSX910/+ezh5igUzLt8g4Qu4dgnhNG7BI=' 
WHERE 
  key_id = 'e17759626f4d86c7326ebb3512e636ede3e0ba1e15039dabcfd54a4e6e21a79e' 
  AND (
    token = 'tp3SUdyDf3NSX910/+ezh5igUzLt8g4Qu4dgnhNG7BI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044