UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eOGqLexh9lc2tukZc1UlxNijr3W/VMpQ1jMCgnAWAZY=' 
WHERE 
  key_id = '9b3aef0778c2a6c165880e4f98107235b91199d2827313abed4537b0e7900b0f' 
  AND (
    token = 'eOGqLexh9lc2tukZc1UlxNijr3W/VMpQ1jMCgnAWAZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029