UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tblFajnQuDqln1RPg1OMhf7B48kxOcGonDjYihAItcI=' 
WHERE 
  key_id = '03258fc6038d915576cf6fd33bd02cd726066dae7eda8695624a4fcf20817ebc' 
  AND (
    token = 'tblFajnQuDqln1RPg1OMhf7B48kxOcGonDjYihAItcI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036