UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XatGv3/sUrF17ofpDf1/Ut6SyIaYeM7XEWJiQaYVtEg=' 
WHERE 
  key_id = '22655829d1717c9449715e0014f1bd3aa69d58a13fe7e3e24826c91b42a1aa89' 
  AND (
    token = 'XatGv3/sUrF17ofpDf1/Ut6SyIaYeM7XEWJiQaYVtEg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025