UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a4awdkxlr3Vxzmtix27xiDExYiUQvRtmCi44GClZ8Pg=' 
WHERE 
  key_id = '983d3206590e934855a2867dfb531fb00c8b3f38bc564ce379dcc4773a2675fc' 
  AND (
    token = 'a4awdkxlr3Vxzmtix27xiDExYiUQvRtmCi44GClZ8Pg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016