UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IVlgvnQUMtURj546ePclhKv6Mj2lGB3dyNI6mmsciMw=' 
WHERE 
  key_id = '89ec03dac2f31054e9775d033a6d53a1989eefb42e6c093444bff458477a9f42' 
  AND (
    token = 'IVlgvnQUMtURj546ePclhKv6Mj2lGB3dyNI6mmsciMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048