UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bmDOgv46eYRquQ73o5L9jcy2HZ+QtigwjFiKfZF3Q4M=' 
WHERE 
  key_id = '8739dcf76cb58808000556c7d07b8641f7bebb4c0278d1153c8e4b47fc156d72' 
  AND (
    token = 'bmDOgv46eYRquQ73o5L9jcy2HZ+QtigwjFiKfZF3Q4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039